home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / modulo.z / modulo
Encoding:
Text File  |  2002-10-03  |  1.9 KB  |  55 lines

  1. MODULO(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      MMOODDUULLOO - Modulo function
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMOODDUULLOO (([AA==]_a,, [PP==]_p))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMOODDUULLOO function returns the remainder of _a divided by _p using
  20.      modulo math.  The result always has the sign of the modulo base, _p.
  21.  
  22.      This function accepts the following arguments:
  23.  
  24.      _a         Must be of type integer or real
  25.  
  26.      _p         Must be of the same type and kind type parameter as _a
  27.  
  28.      MMOODDUULLOO is an elemental function.  The name of this intrinsic cannot be
  29.      passed as an argument.
  30.  
  31. RREETTUURRNN VVAALLUUEESS
  32.      The result type and type parameter are the same as _a.
  33.  
  34.      When _a is of type integer, if _p is not equal to zero, MMOODDUULLOO (_a, _p)
  35.      has the value _r such that _a == _q x _p ++ _r, where _q is an integer.  The
  36.      inequality 0 <= _r < _p holds if _p > 0, and _p < _r <= 0 holds if _p < 0.
  37.      If _p = 0, the result is 0.
  38.  
  39.      When _a is of type real, if _p is not equal to zero, the value of the
  40.      result is _a - FFLLOOOORR (_a / _p) * _p.  The result can be a NaN when that
  41.      value is available.
  42.  
  43. EEXXAAMMPPLLEESS
  44.      Example 1.  MMOODDUULLOO((88,,55)) has the value 3.
  45.  
  46.      Example 2.  MMOODDUULLOO((--88,,55)) has the value 2.
  47.  
  48.      Example 3.  MMOODDUULLOO((88,,--55)) has the value -2.
  49.  
  50.      Example 4.  MMOODDUULLOO((--88,,--55)) has the value -3.
  51.  
  52. SSEEEE AALLSSOO
  53.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  54.      man page.
  55.